//
//  UtilConstants.h
//  BTDemo
//
//  Created by Avery on 14-8-22.
//  Copyright (c) 2014年 Alvin. All rights reserved.
//

/* Import Headers */
#import "XLog.h"

/* Singleton */
#define SingleInstance(Clazz)                   \
    +(Clazz*)shareInstance {                    \
                                                \
        static Clazz *instance = nil;           \
        static dispatch_once_t _once;           \
                                                \
        dispatch_once(&_once, ^{                \
            instance = [[self alloc] init];     \
        });                                     \
        return instance;                        \
    }

/* String */
#define string(s,...) [NSString stringWithFormat:(s), ##__VA_ARGS__]

/* Log */
#define MLog(s,...) \
[[XLog shareInstance] logTag:NSStringFromClass([self class]) Message:[NSString stringWithFormat:(s),##__VA_ARGS__]]

#define xLog(c,s,...) \
[[XLog shareInstance] logTag:c Message:[NSString stringWithFormat:(s),##__VA_ARGS__]]

//判断是否为IOS7
#define is_IOS7 ([[UIDevice currentDevice].systemVersion floatValue]>=7.0)
//判断是否为iphone5
#define is_iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)

